package com.vooda.business_admin.common;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class RspDataTableDto<T> {

    private Integer draw;
    /**
     * 数据总数
     */
    private Long recordsTotal;
    /**
     * 过滤后的记录数（如果有接收到前台的过滤条件，则返回的是过滤后的记录数）
     */
    private Long recordsFiltered;
    /**
     * 数据内容
     */
    private List<T> data;
    /**
     * 后台出错提示文字
     */
    private String error;

    public RspDataTableDto(Integer draw, Long recordsTotal, List<T> data) {
        this.draw = draw;
        this.recordsTotal = recordsTotal;
        this.recordsFiltered = recordsTotal;
        this.data = data;
    }
}
